#include "uisendedittext.h"
#include <QDebug>
#include <QKeyEvent>
#include <QEvent>
#include "mainwindow.h"

UiSendEditText::UiSendEditText()
{
    this ->pWindow = NULL;
}

void UiSendEditText::register_key_enter_handler(QMainWindow* pWindow)
{

    this->pWindow = pWindow;
}

void UiSendEditText::keyReleaseEvent(QKeyEvent* e)
{
    MainWindow* pMainWind = NULL;
    if ( e->key() == Qt::Key_Return)
    {
        if (this->pWindow)
        {
            pMainWind = (MainWindow*)pWindow;
            pMainWind ->sendPushButtonClick();
        }
    }
}
